Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(957)

Unified Diff: openssl/crypto/bio/bss_fd.c

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « openssl/crypto/bio/bss_dgram.c ('k') | openssl/crypto/bio/bss_file.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: openssl/crypto/bio/bss_fd.c
===================================================================
--- openssl/crypto/bio/bss_fd.c (revision 105093)
+++ openssl/crypto/bio/bss_fd.c (working copy)
@@ -60,7 +60,14 @@
#include <errno.h>
#define USE_SOCKETS
#include "cryptlib.h"
+
+#if defined(OPENSSL_NO_POSIX_IO)
/*
+ * One can argue that one should implement dummy placeholder for
+ * BIO_s_fd here...
+ */
+#else
+/*
* As for unconditional usage of "UPLINK" interface in this module.
* Trouble is that unlike Unix file descriptors [which are indexes
* in kernel-side per-process table], corresponding descriptors on
@@ -77,6 +84,7 @@
static int fd_write(BIO *h, const char *buf, int num);
static int fd_read(BIO *h, char *buf, int size);
static int fd_puts(BIO *h, const char *str);
+static int fd_gets(BIO *h, char *buf, int size);
static long fd_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static int fd_new(BIO *h);
static int fd_free(BIO *data);
@@ -88,7 +96,7 @@
fd_write,
fd_read,
fd_puts,
- NULL, /* fd_gets, */
+ fd_gets,
fd_ctrl,
fd_new,
fd_free,
@@ -227,6 +235,22 @@
return(ret);
}
+static int fd_gets(BIO *bp, char *buf, int size)
+ {
+ int ret=0;
+ char *ptr=buf;
+ char *end=buf+size-1;
+
+ while ( (ptr < end) && (fd_read(bp, ptr, 1) > 0) && (ptr[0] != '\n') )
+ ptr++;
+
+ ptr[0]='\0';
+
+ if (buf[0] != '\0')
+ ret=strlen(buf);
+ return(ret);
+ }
+
int BIO_fd_should_retry(int i)
{
int err;
@@ -292,3 +316,4 @@
}
return(0);
}
+#endif
« no previous file with comments | « openssl/crypto/bio/bss_dgram.c ('k') | openssl/crypto/bio/bss_file.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698