Commit e5704b4e authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

webservices: Build a session dictionary for strings not present in the static dictionary.

parent 18a77c32
...@@ -1055,6 +1055,22 @@ HRESULT channel_send_message( WS_CHANNEL *handle, WS_MESSAGE *msg ) ...@@ -1055,6 +1055,22 @@ HRESULT channel_send_message( WS_CHANNEL *handle, WS_MESSAGE *msg )
return hr; return hr;
} }
static HRESULT CALLBACK dict_cb( void *state, const WS_XML_STRING *str, BOOL *found, ULONG *id, WS_ERROR *error )
{
struct dictionary *dict = state;
HRESULT hr = S_OK;
int index;
if ((index = find_string( dict, str->bytes, str->length, id )) == -1 ||
(hr = insert_string( dict, str->bytes, str->length, index, id )) == S_OK)
{
*found = TRUE;
return S_OK;
}
*found = FALSE;
return hr;
}
static HRESULT init_writer( struct channel *channel ) static HRESULT init_writer( struct channel *channel )
{ {
WS_XML_WRITER_BUFFER_OUTPUT buf = {{WS_XML_WRITER_OUTPUT_TYPE_BUFFER}}; WS_XML_WRITER_BUFFER_OUTPUT buf = {{WS_XML_WRITER_OUTPUT_TYPE_BUFFER}};
...@@ -1073,8 +1089,13 @@ static HRESULT init_writer( struct channel *channel ) ...@@ -1073,8 +1089,13 @@ static HRESULT init_writer( struct channel *channel )
break; break;
case WS_ENCODING_XML_BINARY_SESSION_1: case WS_ENCODING_XML_BINARY_SESSION_1:
bin.staticDictionary = (WS_XML_DICTIONARY *)&dict_builtin_static.dict; if ((hr = writer_enable_lookup( channel->writer )) != S_OK) return hr;
/* fall through */ clear_dict( &channel->dict );
bin.staticDictionary = (WS_XML_DICTIONARY *)&dict_builtin_static.dict;
bin.dynamicStringCallback = dict_cb;
bin.dynamicStringCallbackState = &channel->dict;
encoding = &bin.encoding;
break;
case WS_ENCODING_XML_BINARY_1: case WS_ENCODING_XML_BINARY_1:
encoding = &bin.encoding; encoding = &bin.encoding;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment