static
void
wait_func(int delta,
	  int * signalled,
	  int * timedout)
{
    int			save_errno = 0;
    globus_abstime_t	timeout;

    globus_mutex_lock(&mutex);

    /* Absolute timeout */
    timeout.tv_sec = time(GLOBUS_NULL) + delta;
    timeout.tv_nsec = 0;

    while(!done)
    {
	save_errno = globus_cond_timedwait(&cond,
					   &mutex,
					   &timeout);
	if(save_errno == ETIMEDOUT)
	{
	    /* time-out occurred */
	    *timedout = GLOBUS_TRUE;
	    break;
	}
    }
    *signalled = done;

    globus_mutex_unlock(&mutex);
}
static void
transfer(
    globus_gridftp_server_control_op_t      op,
    void *                                  data_handle,
    const char *                            local_target,
    const char *                            mod_name,
    const char *                            mod_parms,
    globus_range_list_t                     range_list,
    void *                                  user_arg)
{
    int                                     ctr;
    globus_size_t                           off = 0;
    globus_size_t                           len = 256;
    globus_abstime_t                        abstime;

    globus_gridftp_server_control_events_enable(
        op,
        GLOBUS_GRIDFTP_SERVER_CONTROL_EVENT_ABORT,
        abort_cb,
        NULL);

    globus_gridftp_server_control_events_enable(
        op,
        GLOBUS_GRIDFTP_SERVER_CONTROL_EVENT_PERF |
                GLOBUS_GRIDFTP_SERVER_CONTROL_EVENT_RESTART,

        event_cb,
        NULL);

    globus_gridftp_server_control_begin_transfer(op);

    globus_mutex_lock(&gs_l_mutex);
    {
        for(ctr = 0; ctr < 500 && !globus_l_done; ctr++)
        {
            GlobusTimeAbstimeSet(abstime, 0, 50000);
            globus_cond_timedwait(&gs_l_cond, &gs_l_mutex, &abstime);
            off += len;
        }
    }
    globus_mutex_unlock(&gs_l_mutex);

    globus_gridftp_server_control_finished_transfer(
        op, GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_SUCCESS, NULL);



    globus_l_done = GLOBUS_FALSE;
}