Work around cppdbg spamming mono errors to stdout
This commit is contained in:
parent
ea1962e11b
commit
0cfe1ec99b
1 changed files with 6 additions and 0 deletions
|
|
@ -152,6 +152,11 @@ class DebugAdapterConnection( object ):
|
||||||
if len( parts ) > 1:
|
if len( parts ) > 1:
|
||||||
headers = parts[ 0 ]
|
headers = parts[ 0 ]
|
||||||
for header_line in headers.split( bytes( '\r\n', 'utf-8' ) ):
|
for header_line in headers.split( bytes( '\r\n', 'utf-8' ) ):
|
||||||
|
if bytes( '\n', 'utf-8' ) in header_line:
|
||||||
|
# Work around bugs in cppdbg where mono spams nonesense to stdout.
|
||||||
|
# This is such a dodgyhack, but it fixes the issues.
|
||||||
|
header_line = header_line.split( bytes( '\n', 'utf-8' ) )[ -1 ]
|
||||||
|
|
||||||
if header_line.strip():
|
if header_line.strip():
|
||||||
key, value = str( header_line, 'utf-8' ).split( ':', 1 )
|
key, value = str( header_line, 'utf-8' ).split( ':', 1 )
|
||||||
self._headers[ key ] = value
|
self._headers[ key ] = value
|
||||||
|
|
@ -172,6 +177,7 @@ class DebugAdapterConnection( object ):
|
||||||
# Skip to reading headers. Because, what else can we do.
|
# Skip to reading headers. Because, what else can we do.
|
||||||
self._logger.error( 'Missing Content-Length header in: {0}'.format(
|
self._logger.error( 'Missing Content-Length header in: {0}'.format(
|
||||||
json.dumps( self._headers ) ) )
|
json.dumps( self._headers ) ) )
|
||||||
|
|
||||||
self._buffer = bytes( '', 'utf-8' )
|
self._buffer = bytes( '', 'utf-8' )
|
||||||
self._SetState( 'READ_HEADER' )
|
self._SetState( 'READ_HEADER' )
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue