author | Tero Marttila <terom@fixme.fi> |
Thu, 21 May 2009 16:56:42 +0300 | |
changeset 210 | 05abca972db0 |
parent 180 | 22967b165692 |
permissions | -rw-r--r-- |
1
cf0e1bb6bcab
a fancy socket abstraction layer, with TCP, next, SSL. Also, .hgignore
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
|
cf0e1bb6bcab
a fancy socket abstraction layer, with TCP, next, SSL. Also, .hgignore
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
#include "sock_internal.h" |
180
22967b165692
rename sock_ssl/sock_gnutls -> ssl/ssl_client
Tero Marttila <terom@fixme.fi>
parents:
155
diff
changeset
|
3 |
#include "ssl_internal.h" |
2
a834f0559939
working SSL using gnutls - a bit of a painful process
Tero Marttila <terom@fixme.fi>
parents:
1
diff
changeset
|
4 |
|
3 | 5 |
#include <assert.h> |
6 |
||
9
4c4c906cc649
add sock_stream_callbacks and ev_base
Tero Marttila <terom@fixme.fi>
parents:
8
diff
changeset
|
7 |
// global sock_stream_ctx instance |
4c4c906cc649
add sock_stream_callbacks and ev_base
Tero Marttila <terom@fixme.fi>
parents:
8
diff
changeset
|
8 |
struct sock_stream_ctx _sock_stream_ctx; |
4c4c906cc649
add sock_stream_callbacks and ev_base
Tero Marttila <terom@fixme.fi>
parents:
8
diff
changeset
|
9 |
|
4c4c906cc649
add sock_stream_callbacks and ev_base
Tero Marttila <terom@fixme.fi>
parents:
8
diff
changeset
|
10 |
err_t sock_init (struct event_base *ev_base, struct error_info *err) |
2
a834f0559939
working SSL using gnutls - a bit of a painful process
Tero Marttila <terom@fixme.fi>
parents:
1
diff
changeset
|
11 |
{ |
9
4c4c906cc649
add sock_stream_callbacks and ev_base
Tero Marttila <terom@fixme.fi>
parents:
8
diff
changeset
|
12 |
// store ev_base |
4c4c906cc649
add sock_stream_callbacks and ev_base
Tero Marttila <terom@fixme.fi>
parents:
8
diff
changeset
|
13 |
_sock_stream_ctx.ev_base = ev_base; |
4c4c906cc649
add sock_stream_callbacks and ev_base
Tero Marttila <terom@fixme.fi>
parents:
8
diff
changeset
|
14 |
|
4
a3ca0f97a075
change ERROR_* to use pointers again, and implement error_info for sock_init
Tero Marttila <terom@fixme.fi>
parents:
3
diff
changeset
|
15 |
// XXX: just call these all directly for now |
180
22967b165692
rename sock_ssl/sock_gnutls -> ssl/ssl_client
Tero Marttila <terom@fixme.fi>
parents:
155
diff
changeset
|
16 |
if (ssl_global_init(err)) |
4
a3ca0f97a075
change ERROR_* to use pointers again, and implement error_info for sock_init
Tero Marttila <terom@fixme.fi>
parents:
3
diff
changeset
|
17 |
return ERROR_CODE(err); |
3 | 18 |
|
4
a3ca0f97a075
change ERROR_* to use pointers again, and implement error_info for sock_init
Tero Marttila <terom@fixme.fi>
parents:
3
diff
changeset
|
19 |
// done |
a3ca0f97a075
change ERROR_* to use pointers again, and implement error_info for sock_init
Tero Marttila <terom@fixme.fi>
parents:
3
diff
changeset
|
20 |
return SUCCESS; |
2
a834f0559939
working SSL using gnutls - a bit of a painful process
Tero Marttila <terom@fixme.fi>
parents:
1
diff
changeset
|
21 |
} |
1
cf0e1bb6bcab
a fancy socket abstraction layer, with TCP, next, SSL. Also, .hgignore
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
22 |