Deleted Added
full compact
bss_rtcp.c (59191) bss_rtcp.c (68651)
1/* crypto/bio/bss_rtcp.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 74 unchanged lines hidden (view full) ---

83};
84#define RPC_HDR_SIZE (sizeof(struct rpc_msg) - 4092)
85
86struct rpc_ctx {
87 int filled, pos;
88 struct rpc_msg msg;
89};
90
1/* crypto/bio/bss_rtcp.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 74 unchanged lines hidden (view full) ---

83};
84#define RPC_HDR_SIZE (sizeof(struct rpc_msg) - 4092)
85
86struct rpc_ctx {
87 int filled, pos;
88 struct rpc_msg msg;
89};
90
91static int rtcp_write(BIO *h,char *buf,int num);
91static int rtcp_write(BIO *h,const char *buf,int num);
92static int rtcp_read(BIO *h,char *buf,int size);
92static int rtcp_read(BIO *h,char *buf,int size);
93static int rtcp_puts(BIO *h,char *str);
93static int rtcp_puts(BIO *h,const char *str);
94static int rtcp_gets(BIO *h,char *str,int size);
94static int rtcp_gets(BIO *h,char *str,int size);
95static long rtcp_ctrl(BIO *h,int cmd,long arg1,char *arg2);
95static long rtcp_ctrl(BIO *h,int cmd,long arg1,void *arg2);
96static int rtcp_new(BIO *h);
97static int rtcp_free(BIO *data);
98
99static BIO_METHOD rtcp_method=
100 {
101 BIO_TYPE_FD,
102 "RTCP",
103 rtcp_write,

--- 47 unchanged lines hidden (view full) ---

151/***************************************************************************/
152
153static int rtcp_new(BIO *bi)
154{
155 struct rpc_ctx *ctx;
156 bi->init=1;
157 bi->num=0;
158 bi->flags = 0;
96static int rtcp_new(BIO *h);
97static int rtcp_free(BIO *data);
98
99static BIO_METHOD rtcp_method=
100 {
101 BIO_TYPE_FD,
102 "RTCP",
103 rtcp_write,

--- 47 unchanged lines hidden (view full) ---

151/***************************************************************************/
152
153static int rtcp_new(BIO *bi)
154{
155 struct rpc_ctx *ctx;
156 bi->init=1;
157 bi->num=0;
158 bi->flags = 0;
159 bi->ptr=Malloc(sizeof(struct rpc_ctx));
159 bi->ptr=OPENSSL_malloc(sizeof(struct rpc_ctx));
160 ctx = (struct rpc_ctx *) bi->ptr;
161 ctx->filled = 0;
162 ctx->pos = 0;
163 return(1);
164}
165
166static int rtcp_free(BIO *a)
167{
168 if (a == NULL) return(0);
160 ctx = (struct rpc_ctx *) bi->ptr;
161 ctx->filled = 0;
162 ctx->pos = 0;
163 return(1);
164}
165
166static int rtcp_free(BIO *a)
167{
168 if (a == NULL) return(0);
169 if ( a->ptr ) Free ( a->ptr );
169 if ( a->ptr ) OPENSSL_free ( a->ptr );
170 a->ptr = NULL;
171 return(1);
172}
173
174static int rtcp_read(BIO *b, char *out, int outl)
175{
176 int status, length;
177 struct rpc_ctx *ctx;

--- 35 unchanged lines hidden (view full) ---

213 memmove ( out, ctx->msg.data, length );
214 ctx->pos += length;
215 return length;
216 }
217
218 return length;
219}
220
170 a->ptr = NULL;
171 return(1);
172}
173
174static int rtcp_read(BIO *b, char *out, int outl)
175{
176 int status, length;
177 struct rpc_ctx *ctx;

--- 35 unchanged lines hidden (view full) ---

213 memmove ( out, ctx->msg.data, length );
214 ctx->pos += length;
215 return length;
216 }
217
218 return length;
219}
220
221static int rtcp_write(BIO *b, char *in, int inl)
221static int rtcp_write(BIO *b, const char *in, int inl)
222{
223 int status, i, segment, length;
224 struct rpc_ctx *ctx;
225 /*
226 * Output data, send in chunks no larger that sizeof(ctx->msg.data).
227 */
228 ctx = (struct rpc_ctx *) b->ptr;
229 for ( i = 0; i < inl; i += segment ) {

--- 12 unchanged lines hidden (view full) ---

242 printf("unexpected response when confirming put %c %c\n",
243 ctx->msg.channel, ctx->msg.function );
244
245 }
246 }
247 return(i);
248}
249
222{
223 int status, i, segment, length;
224 struct rpc_ctx *ctx;
225 /*
226 * Output data, send in chunks no larger that sizeof(ctx->msg.data).
227 */
228 ctx = (struct rpc_ctx *) b->ptr;
229 for ( i = 0; i < inl; i += segment ) {

--- 12 unchanged lines hidden (view full) ---

242 printf("unexpected response when confirming put %c %c\n",
243 ctx->msg.channel, ctx->msg.function );
244
245 }
246 }
247 return(i);
248}
249
250static long rtcp_ctrl(BIO *b, int cmd, long num, char *ptr)
250static long rtcp_ctrl(BIO *b, int cmd, long num, void *ptr)
251 {
252 long ret=1;
253
254 switch (cmd)
255 {
256 case BIO_CTRL_RESET:
257 case BIO_CTRL_EOF:
258 ret = 1;

--- 19 unchanged lines hidden (view full) ---

278 return(ret);
279 }
280
281static int rtcp_gets(BIO *bp, char *buf, int size)
282 {
283 return(0);
284 }
285
251 {
252 long ret=1;
253
254 switch (cmd)
255 {
256 case BIO_CTRL_RESET:
257 case BIO_CTRL_EOF:
258 ret = 1;

--- 19 unchanged lines hidden (view full) ---

278 return(ret);
279 }
280
281static int rtcp_gets(BIO *bp, char *buf, int size)
282 {
283 return(0);
284 }
285
286static int rtcp_puts(BIO *bp, char *str)
286static int rtcp_puts(BIO *bp, const char *str)
287{
288 int length;
289 if (str == NULL) return(0);
290 length = strlen ( str );
291 if ( length == 0 ) return (0);
292 return rtcp_write ( bp,str, length );
293}
294
287{
288 int length;
289 if (str == NULL) return(0);
290 length = strlen ( str );
291 if ( length == 0 ) return (0);
292 return rtcp_write ( bp,str, length );
293}
294