]> granicus.if.org Git - curl/commitdiff
Martin Hedenfalk added sec_fflush_fd()
authorDaniel Stenberg <daniel@haxx.se>
Mon, 25 Sep 2000 22:15:56 +0000 (22:15 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 25 Sep 2000 22:15:56 +0000 (22:15 +0000)
lib/security.c
lib/security.h

index 81ce35ed85ef9e0f4f78cd054c9937642bf279f2..793169f000b6061140f33b3808f67b00da04d8fa 100644 (file)
@@ -272,6 +272,20 @@ sec_fflush(struct connectdata *conn, FILE *F)
   return 0;
 }
 
+int
+sec_fflush_fd(struct connectdata *conn, int fd)
+{
+  if(conn->data_prot != prot_clear) {
+    if(conn->out_buffer.index > 0){
+      sec_write(conn, fd,
+                conn->out_buffer.data, conn->out_buffer.index);
+      conn->out_buffer.index = 0;
+    }
+    sec_send(conn, fd, NULL, 0);
+  }
+  return 0;
+}
+
 int
 sec_write(struct connectdata *conn, int fd, char *buffer, int length)
 {
index b496fad71103adb7b2a21699ac163776c5dc4ffa..4a30560cb3ddf0541ec71ad448c9b2d7904c8dff 100644 (file)
@@ -94,6 +94,7 @@ void delete_ftp_command(void);
 
 
 int sec_fflush (struct connectdata *conn, FILE *);
+int sec_fflush_fd(struct connectdata *conn, int fd);
 int sec_fprintf (struct connectdata *, FILE *, const char *, ...);
 int sec_getc (struct connectdata *conn, FILE *);
 int sec_putc (struct connectdata *conn, int, FILE *);