rem: DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin send phase (socket=%d mode=%hd count=%lu)\n", soap->socket, soap->mode, (unsigned long)soap->count));
add: DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin send phase (socket=%d mode=%x count=%lu)\n", soap->socket, soap->mode, (unsigned long)soap->count)); if (soap->fprepareinit && (soap->mode & SOAP_IO) == SOAP_IO_STORE) soap->fprepareinit(soap);
context: soap_begin_send(struct soap *soap){ soap_clr_attr(soap);  soap_set_local_namespaces(soap);  soap->mode = (soap->omode & ~SOAP_IO_LENGTH) | (soap->mode & SOAP_ENC_DIME);  if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)  { if (soap->mode & SOAP_ENC_XML)      soap->mode |= SOAP_IO_BUFFER;    else      soap->mode |= SOAP_IO_STORE;  }  if ((soap->mode & SOAP_IO) == SOAP_IO_FLUSH && soap_valid_socket(soap->socket))  { if (soap->count || (soap->mode & SOAP_ENC_XML))      soap->mode |= SOAP_IO_BUFFER;    else      soap->mode |= SOAP_IO_STORE;  }  if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)    soap_new_block(soap);  if (!(soap->mode & SOAP_IO_KEEPALIVE))    soap->keep_alive = 0;#ifdef WIN32#ifndef UNDER_CE#ifndef WITH_FASTCGI  if (!soap_valid_socket(soap->socket)) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */#ifdef __BORLANDC__    setmode((SOAP_SOCKET)soap->sendfd, O_BINARY);#else    _setmode((SOAP_SOCKET)soap->sendfd, _O_BINARY);#endif#endif#endif#endif  if (soap->mode & SOAP_IO)  { soap->bufidx = 0;    soap->buflen = 0;  }  soap->chunksize = 0;  soap->ns = 0;  soap->null = 0;  soap->position = 0;  soap->mustUnderstand = 0;  soap->encoding = 0;  soap->part = SOAP_BEGIN;  soap->idnum = 0;  soap->level = 0;#ifdef WITH_ZLIB  soap->z_ratio_out = 1.0;  if ((soap->mode & SOAP_ENC_ZLIB) && soap->zlib_state != SOAP_ZLIB_DEFLATE)  {#ifdef WITH_GZIP    memcpy(soap->z_buf, "\37\213\10\0\0\0\0\0\0\377", 10);    soap->d_stream.next_out = (Byte*)soap->z_buf + 10;    soap->d_stream.avail_out = SOAP_BUFLEN - 10;    soap->z_crc = crc32(0L, NULL, 0);    if (deflateInit2(&soap->d_stream, soap->z_level, Z_DEFLATED, -MAX_WBITS, 8, Z_DEFAULT_STRATEGY) != Z_OK)#else    soap->d_stream.next_out = (Byte*)soap->z_buf;    soap->d_stream.avail_out = SOAP_BUFLEN;    if (deflateInit(&soap->d_stream, soap->z_level) != Z_OK)#endif      return soap->error = SOAP_ZLIB_ERROR;    DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflate initialized\n"));    soap->zlib_state = SOAP_ZLIB_DEFLATE;  }#endif  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin send phase (socket=%d mode=%hd count=%lu)\n", soap->socket, soap->mode, (unsigned long)soap->count));  return SOAP_OK;}