| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // Written in NSPR style to also be suitable for adding to the NSS demo suite | 4 // Written in NSPR style to also be suitable for adding to the NSS demo suite |
| 5 | 5 |
| 6 #ifndef __MEMIO_H | 6 #ifndef __MEMIO_H |
| 7 #define __MEMIO_H | 7 #define __MEMIO_H |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 usual to the nspr file descriptor returned by SSL_ImportFD, | 30 usual to the nspr file descriptor returned by SSL_ImportFD, |
| 31 your app must shuttle encrypted data between | 31 your app must shuttle encrypted data between |
| 32 the real network and memio's network buffers. | 32 the real network and memio's network buffers. |
| 33 memio_GetReadParams/memio_PutReadResult | 33 memio_GetReadParams/memio_PutReadResult |
| 34 are the hooks you need to pump data into memio's input buffer, | 34 are the hooks you need to pump data into memio's input buffer, |
| 35 and memio_GetWriteParams/memio_PutWriteResult | 35 and memio_GetWriteParams/memio_PutWriteResult |
| 36 are the hooks you need to pump data out of memio's output buffer. | 36 are the hooks you need to pump data out of memio's output buffer. |
| 37 ----------------------------------------------------------------------*/ | 37 ----------------------------------------------------------------------*/ |
| 38 | 38 |
| 39 /* Create the I/O layer and its two circular buffers. */ | 39 /* Create the I/O layer and its two circular buffers. */ |
| 40 PRFileDesc *memio_CreateIOLayer(int bufsize); | 40 PRFileDesc *memio_CreateIOLayer(int readbufsize, int writebufsize); |
| 41 | 41 |
| 42 /* Must call before trying to make an ssl connection */ | 42 /* Must call before trying to make an ssl connection */ |
| 43 void memio_SetPeerName(PRFileDesc *fd, const PRNetAddr *peername); | 43 void memio_SetPeerName(PRFileDesc *fd, const PRNetAddr *peername); |
| 44 | 44 |
| 45 /* Return a private pointer needed by the following | 45 /* Return a private pointer needed by the following |
| 46 * four functions. (We could have passed a PRFileDesc to | 46 * four functions. (We could have passed a PRFileDesc to |
| 47 * them, but that would be slower. Better for the caller | 47 * them, but that would be slower. Better for the caller |
| 48 * to grab the pointer once and cache it. | 48 * to grab the pointer once and cache it. |
| 49 * This may be a premature optimization.) | 49 * This may be a premature optimization.) |
| 50 */ | 50 */ |
| (...skipping 29 matching lines...) Expand all Loading... |
| 80 * map from Unix errors to NSPR error codes. | 80 * map from Unix errors to NSPR error codes. |
| 81 * On EWOULDBLOCK or the equivalent, don't call this function. | 81 * On EWOULDBLOCK or the equivalent, don't call this function. |
| 82 */ | 82 */ |
| 83 void memio_PutWriteResult(memio_Private *secret, int bytes_written); | 83 void memio_PutWriteResult(memio_Private *secret, int bytes_written); |
| 84 | 84 |
| 85 #ifdef __cplusplus | 85 #ifdef __cplusplus |
| 86 } | 86 } |
| 87 #endif | 87 #endif |
| 88 | 88 |
| 89 #endif | 89 #endif |
| OLD | NEW |