Add a missing comma in OPENSSL_malloc.pod
[openssl.git] / doc / crypto / BIO_s_connect.pod
index d1e605172b538b20f013a9e88d1b6b34fedd1753..d97d5899a521fa0373db650bab478f3300b54f0c 100644 (file)
@@ -81,7 +81,7 @@ This return value is an internal pointer which should not be modified.
 BIO_set_nbio() sets the non blocking I/O flag to B<n>. If B<n> is
 zero then blocking I/O is set. If B<n> is 1 then non blocking I/O
 is set. Blocking I/O is the default. The call to BIO_set_nbio()
-should be made before the connection is established because 
+should be made before the connection is established because
 non blocking I/O is set during the connect process.
 
 BIO_new_connect() combines BIO_new() and BIO_set_conn_hostname() into
@@ -167,16 +167,17 @@ to retrieve a page and copy the result to standard output.
 
  cbio = BIO_new_connect("localhost:http");
  out = BIO_new_fp(stdout, BIO_NOCLOSE);
- if(BIO_do_connect(cbio) <= 0) {
-       fprintf(stderr, "Error connecting to server\n");
-       ERR_print_errors_fp(stderr);
-       /* whatever ... */
      }
+ if (BIO_do_connect(cbio) <= 0) {
+     fprintf(stderr, "Error connecting to server\n");
+     ERR_print_errors_fp(stderr);
+     exit(1);
+ }
  BIO_puts(cbio, "GET / HTTP/1.0\n\n");
- for(;;) {     
-       len = BIO_read(cbio, tmpbuf, 1024);
-       if(len <= 0) break;
-       BIO_write(out, tmpbuf, len);
+ for ( ; ; ) {
+     len = BIO_read(cbio, tmpbuf, 1024);
+     if(len <= 0)
+         break;
+     BIO_write(out, tmpbuf, len);
  }
  BIO_free(cbio);
  BIO_free(out);
@@ -186,4 +187,13 @@ to retrieve a page and copy the result to standard output.
 
 L<BIO_ADDR(3)>
 
+=head1 COPYRIGHT
+
+Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+
+Licensed under the OpenSSL license (the "License").  You may not use
+this file except in compliance with the License.  You can obtain a copy
+in the file LICENSE in the source distribution or at
+L<https://www.openssl.org/source/license.html>.
+
 =cut