session.c (6aae6f7e7aa3b66bf251fa5843bfcf34c746ed70) | session.c (a4b187fa33f1856b9c0293b900d36b4c797b459d) |
---|---|
1/* 2 * session.c 3 * 4 * Copyright (c) 2001-2003 Maksim Yevmenkin <m_evmenkin@yahoo.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 88 unchanged lines hidden (view full) --- 97 } 98 ss->rsp_e = ss->rsp + ss->imtu; 99 ss->error = 0; 100fail: 101 return ((void *) ss); 102} 103 104void * | 1/* 2 * session.c 3 * 4 * Copyright (c) 2001-2003 Maksim Yevmenkin <m_evmenkin@yahoo.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 88 unchanged lines hidden (view full) --- 97 } 98 ss->rsp_e = ss->rsp + ss->imtu; 99 ss->error = 0; 100fail: 101 return ((void *) ss); 102} 103 104void * |
105sdp_open_local(void) | 105sdp_open_local(char const *control) |
106{ 107 sdp_session_p ss = NULL; 108 struct sockaddr_un sa; 109 110 if ((ss = calloc(1, sizeof(*ss))) == NULL) 111 goto fail; 112 113 ss->s = socket(PF_UNIX, SOCK_STREAM, 0); 114 if (ss->s < 0) { 115 ss->error = errno; 116 goto fail; 117 } 118 | 106{ 107 sdp_session_p ss = NULL; 108 struct sockaddr_un sa; 109 110 if ((ss = calloc(1, sizeof(*ss))) == NULL) 111 goto fail; 112 113 ss->s = socket(PF_UNIX, SOCK_STREAM, 0); 114 if (ss->s < 0) { 115 ss->error = errno; 116 goto fail; 117 } 118 |
119 if (control == NULL) 120 control = SDP_LOCAL_PATH; 121 |
|
119 sa.sun_len = sizeof(sa); 120 sa.sun_family = AF_UNIX; | 122 sa.sun_len = sizeof(sa); 123 sa.sun_family = AF_UNIX; |
121 strlcpy(sa.sun_path, SDP_LOCAL_PATH, sizeof(sa.sun_path)); | 124 strlcpy(sa.sun_path, control, sizeof(sa.sun_path)); |
122 123 if (connect(ss->s, (struct sockaddr *) &sa, sizeof(sa)) < 0) { 124 ss->error = errno; 125 goto fail; 126 } 127 128 ss->flags |= SDP_SESSION_LOCAL; 129 ss->imtu = ss->omtu = SDP_LOCAL_MTU; --- 45 unchanged lines hidden --- | 125 126 if (connect(ss->s, (struct sockaddr *) &sa, sizeof(sa)) < 0) { 127 ss->error = errno; 128 goto fail; 129 } 130 131 ss->flags |= SDP_SESSION_LOCAL; 132 ss->imtu = ss->omtu = SDP_LOCAL_MTU; --- 45 unchanged lines hidden --- |