static int BIO_dgram_should_retry(int s);
+static void get_current_time(struct timeval *t);
+
static BIO_METHOD methods_dgramp=
{
BIO_TYPE_DGRAM,
if (data->hstimeout.tv_sec > 0 || data->hstimeout.tv_usec > 0)
{
struct timeval curtime;
-#ifdef OPENSSL_SYS_WIN32
- struct _timeb tb;
- _ftime(&tb);
- curtime.tv_sec = (long)tb.time;
- curtime.tv_usec = (long)tb.millitm * 1000;
-#elif defined(OPENSSL_SYS_VMS)
- struct timeb tb;
- ftime(&tb);
- curtime.tv_sec = (long)tb.time;
- curtime.tv_usec = (long)tb.millitm * 1000;
-#else
- gettimeofday(&curtime, NULL);
-#endif
+ get_current_time(&curtime);
if (curtime.tv_sec >= data->hstimeout.tv_sec &&
curtime.tv_usec >= data->hstimeout.tv_usec)
case BIO_CTRL_DGRAM_SET_TIMEOUT:
if (num > 0)
{
-#ifdef OPENSSL_SYS_WIN32
- struct _timeb tb;
- _ftime(&tb);
- data->hstimeout.tv_sec = (long)tb.time;
- data->hstimeout.tv_usec = (long)tb.millitm * 1000;
-#else
- gettimeofday(&(data->hstimeout), NULL);
-#endif
+ get_current_time(&data->hstimeout);
data->hstimeout.tv_sec += data->hstimeoutdiff.tv_sec;
data->hstimeout.tv_usec += data->hstimeoutdiff.tv_usec;
if (data->hstimeout.tv_usec >= 1000000)
return(0);
}
#endif
+
+static void get_current_time(struct timeval *t)
+ {
+#ifdef OPENSSL_SYS_WIN32
+ struct _timeb tb;
+ _ftime(&tb);
+ t->tv_sec = (long)tb.time;
+ t->tv_usec = (long)tb.millitm * 1000;
+#elif defined(OPENSSL_SYS_VMS)
+ struct timeb tb;
+ ftime(&tb);
+ t->tv_sec = (long)tb.time;
+ t->tv_usec = (long)tb.millitm * 1000;
+#else
+ gettimeofday(t, NULL);
+#endif
+ }
-- Richard Levitte */
#ifdef OPENSSL_SYS_VMS
#undef GOST_CLIENT_KEY_EXCHANGE_PARAMS_it
-#defined GOST_CLIENT_KEY_EXCHANGE_PARAMS_it GOST_CLIENT_KEY_EXC_PARAMS_it
+#define GOST_CLIENT_KEY_EXCHANGE_PARAMS_it GOST_CLIENT_KEY_EXC_PARAMS_it
#undef GOST_CLIENT_KEY_EXCHANGE_PARAMS_new
-#defined GOST_CLIENT_KEY_EXCHANGE_PARAMS_new GOST_CLIENT_KEY_EXC_PARAMS_new
+#define GOST_CLIENT_KEY_EXCHANGE_PARAMS_new GOST_CLIENT_KEY_EXC_PARAMS_new
#undef GOST_CLIENT_KEY_EXCHANGE_PARAMS_free
-#defined GOST_CLIENT_KEY_EXCHANGE_PARAMS_free GOST_CLIENT_KEY_EXC_PARAMS_free
+#define GOST_CLIENT_KEY_EXCHANGE_PARAMS_free GOST_CLIENT_KEY_EXC_PARAMS_free
#undef d2i_GOST_CLIENT_KEY_EXCHANGE_PARAMS
-#defined d2i_GOST_CLIENT_KEY_EXCHANGE_PARAMS d2i_GOST_CLIENT_KEY_EXC_PARAMS
+#define d2i_GOST_CLIENT_KEY_EXCHANGE_PARAMS d2i_GOST_CLIENT_KEY_EXC_PARAMS
#undef i2d_GOST_CLIENT_KEY_EXCHANGE_PARAMS
-#defined i2d_GOST_CLIENT_KEY_EXCHANGE_PARAMS i2d_GOST_CLIENT_KEY_EXC_PARAMS
+#define i2d_GOST_CLIENT_KEY_EXCHANGE_PARAMS i2d_GOST_CLIENT_KEY_EXC_PARAMS
#endif /* End of hack */
DECLARE_ASN1_FUNCTIONS(GOST_CLIENT_KEY_EXCHANGE_PARAMS)
typedef struct {