mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-10-07 04:02:18 +03:00
more code cleanup
This commit is contained in:
1 parent
dc29c29144
commit
4f5e802908
12 files changed
+2478
-666
No files matched your search
@@ -487,6 +487,7 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
|
||||
if (sizeOfPtr > MAX_RECV_SIZE || sizeOfPtr == 0)
|
||||
{
|
||||
gnutls_assert (); /* internal error */
|
||||
printf("AT %u\n", __LINE__);
|
||||
return GNUTLS_E_INVALID_REQUEST;
|
||||
}
|
||||
|
||||
@@ -537,6 +538,7 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
|
||||
> MAX_RECV_SIZE)
|
||||
{
|
||||
gnutls_assert (); /* internal error */
|
||||
printf("AT %u\n", __LINE__);
|
||||
return GNUTLS_E_INVALID_REQUEST;
|
||||
}
|
||||
|
||||
@@ -549,12 +551,14 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
|
||||
if (session->internals.record_recv_buffer.data == NULL)
|
||||
{
|
||||
gnutls_assert ();
|
||||
printf("AT %u\n", __LINE__);
|
||||
return GNUTLS_E_MEMORY_ERROR;
|
||||
}
|
||||
|
||||
buf_pos = session->internals.record_recv_buffer.length;
|
||||
buf = session->internals.record_recv_buffer.data;
|
||||
*iptr = buf;
|
||||
printf("AT %u\n", __LINE__);
|
||||
|
||||
/* READ DATA - but leave RCVLOWAT bytes in the kernel buffer. */
|
||||
if (recvdata - recvlowat > 0)
|
||||
@@ -566,6 +570,7 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
|
||||
*/
|
||||
if (ret < 0 && MHD_gtls_error_is_fatal (ret) == 0)
|
||||
{
|
||||
printf("AT %u\n", __LINE__);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -593,6 +598,7 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
|
||||
|
||||
if (ret2 < 0 && MHD_gtls_error_is_fatal (ret2) == 0)
|
||||
{
|
||||
printf("AT %u\n", __LINE__);
|
||||
return ret2;
|
||||
}
|
||||
|
||||
@@ -612,6 +618,7 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
|
||||
{
|
||||
gnutls_assert ();
|
||||
/* that's because they are initialized to 0 */
|
||||
printf("AT %u\n", __LINE__);
|
||||
return MIN (ret, ret2);
|
||||
}
|
||||
|
||||
@@ -620,12 +627,14 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
|
||||
if (ret > 0 && ret < recvlowat)
|
||||
{
|
||||
gnutls_assert ();
|
||||
printf("AT %u\n", __LINE__);
|
||||
return GNUTLS_E_AGAIN;
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
{ /* EOF */
|
||||
gnutls_assert ();
|
||||
printf("AT %u\n", __LINE__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -635,10 +644,12 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
|
||||
{
|
||||
/* Short Read */
|
||||
gnutls_assert ();
|
||||
printf("AT %u\n", __LINE__);
|
||||
return GNUTLS_E_AGAIN;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("AT %u\n", __LINE__);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user