rem: soap->authrealm = NULL;
context: soap_begin_recv(struct soap *soap){ soap_wchar c;  soap->error = SOAP_OK;  soap_free(soap);  soap_set_local_namespaces(soap);  soap->version = 0;	/* don't assume we're parsing SOAP content by default */#ifndef WITH_NOIDREF  soap_free_iht(soap);#endif  if ((soap->imode & SOAP_IO) == SOAP_IO_CHUNK)    soap->omode |= SOAP_IO_CHUNK;  soap->imode &= ~SOAP_IO;  soap->mode = soap->imode;  if (!soap->keep_alive)  { soap->buflen = 0;    soap->bufidx = 0;  }  if (!(soap->mode & SOAP_IO_KEEPALIVE))    soap->keep_alive = 0;  soap->ahead = 0;  soap->peeked = 0;  soap->level = 0;  soap->part = SOAP_BEGIN;  soap->alloced = 0;  soap->count = 0;  soap->length = 0;  soap->cdata = 0;  *soap->endpoint = '\0';  soap->userid = NULL;  soap->passwd = NULL;  soap->action = NULL;  soap->authrealm = NULL;#ifndef WITH_LEANER  soap->dime.chunksize = 0;  soap->dime.buflen = 0;  soap->dime.list = NULL;  soap->dime.first = NULL;  soap->dime.last = NULL;  soap->mime.list = NULL;  soap->mime.first = NULL;  soap->mime.last = NULL;  soap->mime.boundary = NULL;  soap->mime.start = NULL;#endif#ifdef WIN32#ifndef UNDER_CE#ifndef WITH_FASTCGI  if (!soap_valid_socket(soap->socket))#ifdef __BORLANDC__    setmode((SOAP_SOCKET)soap->recvfd, O_BINARY);#else    _setmode((SOAP_SOCKET)soap->recvfd, _O_BINARY);#endif#endif#endif#endif#ifdef WITH_ZLIB  soap->mode &= ~SOAP_ENC_ZLIB;  soap->zlib_in = SOAP_ZLIB_NONE;  soap->zlib_out = SOAP_ZLIB_NONE;  soap->d_stream.next_in = Z_NULL;  soap->d_stream.avail_in = 0;  soap->d_stream.next_out = (Byte*)soap->buf;  soap->d_stream.avail_out = SOAP_BUFLEN;  soap->z_ratio_in = 1.0;#endif#ifndef WITH_LEANER  if (soap->fprepareinit)    soap->fprepareinit(soap);#endif  c = soap_getchar(soap);#ifdef WITH_GZIP  if (c == 0x1F)  { if (soap_getgziphdr(soap))      return soap->error;    if (inflateInit2(&soap->d_stream, -MAX_WBITS) != Z_OK)      return soap->error = SOAP_ZLIB_ERROR;    soap->zlib_state = SOAP_ZLIB_INFLATE;    soap->mode |= SOAP_ENC_ZLIB;    soap->zlib_in = SOAP_ZLIB_GZIP;    soap->z_crc = crc32(0L, NULL, 0);    DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n"));    memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);    /* should not chunk over plain transport, so why bother to check? */    /* if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) */    /*   soap->z_buflen = soap->bufidx; */    /* else */    soap->d_stream.next_in = (Byte*)(soap->z_buf + soap->bufidx);    soap->d_stream.avail_in = soap->buflen - soap->bufidx;    soap->z_buflen = soap->buflen;    soap->buflen = soap->bufidx;    c = soap_getchar(soap);  }  #endif#ifndef WITH_LEANER  if (c == '-' && soap_get0(soap) == '-')    soap->mode |= SOAP_ENC_MIME;  else if ((c & 0xFFFC) == (SOAP_DIME_VERSION | SOAP_DIME_MB) && (soap_get0(soap) & 0xFFF0) == 0x20)    soap->mode |= SOAP_ENC_DIME;  else#endif  { while (soap_blank(c))      c = soap_getchar(soap);  }  if ((int)c == EOF)    return soap->error = SOAP_EOF;  soap_unget(soap, c);#ifndef WITH_NOHTTP  if (c != '<' && !(soap->mode & (SOAP_ENC_DIME | SOAP_ENC_ZLIB)))  { soap->mode &= ~SOAP_IO;    if ((soap->error = soap->fparse(soap)))    { soap->keep_alive = 0; /* force close later */      return soap->error;    }    if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)    { soap->chunkbuflen = soap->buflen;      soap->buflen = soap->bufidx;      soap->chunksize = 0;    }#ifndef WITH_LEANER    else if (soap->fpreparerecv && soap->buflen != soap->bufidx)      soap->fpreparerecv(soap, soap->buf + soap->bufidx, soap->buflen - soap->bufidx);#endif#ifdef WITH_ZLIB    if (soap->zlib_in)    { /* fparse should not use soap_unget to push back last char */#ifdef WITH_GZIP      c = soap_get1(soap);      if (c == 0x1F)      { if (soap_getgziphdr(soap))          return soap->error;        if (inflateInit2(&soap->d_stream, -MAX_WBITS) != Z_OK)          return soap->error = SOAP_ZLIB_ERROR;        soap->zlib_state = SOAP_ZLIB_INFLATE;        soap->z_crc = crc32(0L, NULL, 0);        DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n"));      }      else      { soap_revget1(soap);#else      {#endif        if (inflateInit(&soap->d_stream) != Z_OK)          return soap->error = SOAP_ZLIB_ERROR;        soap->zlib_state = SOAP_ZLIB_INFLATE;        DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate initialized\n"));      }      soap->mode |= SOAP_ENC_ZLIB;      memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);      soap->d_stream.next_in = (Byte*)(soap->z_buf + soap->bufidx);      soap->d_stream.avail_in = soap->buflen - soap->bufidx;      soap->z_buflen = soap->buflen;      soap->buflen = soap->bufidx;    }#endif  }#endif#ifndef WITH_LEANER  if (soap->mode & SOAP_ENC_MIME)  { if (soap_getmimehdr(soap))      return soap->error;    if (soap_get_header_attribute(soap, soap->mime.first->type, "application/dime"))      soap->mode |= SOAP_ENC_DIME;  }  if (soap->mode & SOAP_ENC_DIME)  { if (soap_getdimehdr(soap))      return soap->error;    if (soap->dime.flags & SOAP_DIME_CF)    { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked DIME SOAP message\n"));      soap->dime.chunksize = soap->dime.size;      if (soap->buflen - soap->bufidx >= soap->dime.chunksize)      { soap->dime.buflen = soap->buflen;        soap->buflen = soap->bufidx + soap->dime.chunksize;      }      else        soap->dime.chunksize -= soap->buflen - soap->bufidx;    }    soap->count = soap->buflen - soap->bufidx;  }#endif  return SOAP_OK;}