]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/libstack/osrf_app_session.c
added the md5 server (opensrf.version)
[OpenSRF.git] / src / libstack / osrf_app_session.c
1 #include "osrf_app_session.h"
2 #include <time.h>
3
4 /* the global app_session cache */
5 osrf_app_session* app_session_cache;
6
7
8
9 // --------------------------------------------------------------------------
10 // --------------------------------------------------------------------------
11 // Request API
12 // --------------------------------------------------------------------------
13
14 /** Allocation and initializes a new app_request object */
15 osrf_app_request* _osrf_app_request_init( 
16                 osrf_app_session* session, osrf_message* msg ) {
17
18         osrf_app_request* req = 
19                 (osrf_app_request*) safe_malloc(sizeof(osrf_app_request));
20
21         req->session            = session;
22         req->request_id = msg->thread_trace;
23         req->complete           = 0;
24         req->payload            = msg;
25         req->result                     = NULL;
26
27         return req;
28
29 }
30
31 /** Frees memory used by an app_request object */
32 void _osrf_app_request_free( osrf_app_request * req ){
33         if( req == NULL ) return;
34
35         if( req->payload ) {
36                 osrf_message_free( req->payload );
37         }
38
39         /*
40         osrf_message* cur_msg = req->result;
41         while( cur_msg != NULL ) {
42                 osrf_message* next_msg = cur_msg->next;
43                 osrf_message_free( cur_msg );
44                 cur_msg = next_msg;
45         }
46         osrf_message_free( req->payload );
47         */
48
49         free( req );
50 }
51
52 /** Pushes the given message onto the list of 'responses' to this request */
53 void _osrf_app_request_push_queue( osrf_app_request* req, osrf_message* result ){
54         if(req == NULL || result == NULL) return;
55         debug_handler( "App Session pushing request [%d] onto request queue", result->thread_trace );
56         if(req->result == NULL)
57                 req->result = result;
58         else {
59                 result->next = req->result;
60                 req->result = result;
61         }
62 }
63
64 /** Removes this app_request from our session request set */
65 void osrf_app_session_request_finish( 
66                 osrf_app_session* session, int req_id ){
67
68         if(session == NULL) return;
69         osrf_app_request* req = _osrf_app_session_get_request( session, req_id );
70         if(req == NULL) return;
71         _osrf_app_session_remove_request( req->session, req );
72         _osrf_app_request_free( req );
73 }
74
75
76 void osrf_app_session_request_reset_timeout( osrf_app_session* session, int req_id ) {
77         if(session == NULL) return;
78         debug_handler("Resetting request timeout %d", req_id );
79         osrf_app_request* req = _osrf_app_session_get_request( session, req_id );
80         if(req == NULL) return;
81         req->reset_timeout = 1;
82 }
83
84 /** Checks the receive queue for messages.  If any are found, the first
85   * is popped off and returned.  Otherwise, this method will wait at most timeout 
86   * seconds for a message to appear in the receive queue.  Once it arrives it is returned.
87   * If no messages arrive in the timeout provided, null is returned.
88   */
89 osrf_message* _osrf_app_request_recv( osrf_app_request* req, int timeout ) {
90
91         if(req == NULL) return NULL;
92
93         if( req->result != NULL ) {
94                 /* pop off the first message in the list */
95                 osrf_message* tmp_msg = req->result;
96                 req->result = req->result->next;
97                 return tmp_msg;
98         }
99
100         time_t start = time(NULL);      
101         time_t remaining = (time_t) timeout;
102
103         while( remaining >= 0 ) {
104                 /* tell the session to wait for stuff */
105                 debug_handler( "In app_request receive with remaining time [%d]", (int) remaining );
106
107                 osrf_app_session_queue_wait( req->session, 0 );
108
109                 if( req->result != NULL ) { /* if we received anything */
110                         /* pop off the first message in the list */
111                         debug_handler( "app_request_recv received a message, returning it");
112                         osrf_message* ret_msg = req->result;
113                         osrf_message* tmp_msg = ret_msg->next;
114                         req->result = tmp_msg;
115                         return ret_msg;
116                 }
117
118                 if( req->complete )
119                         return NULL;
120
121                 osrf_app_session_queue_wait( req->session, (int) remaining );
122
123                 if( req->result != NULL ) { /* if we received anything */
124                         /* pop off the first message in the list */
125                         debug_handler( "app_request_recv received a message, returning it");
126                         osrf_message* ret_msg = req->result;
127                         osrf_message* tmp_msg = ret_msg->next;
128                         req->result = tmp_msg;
129                         return ret_msg;
130                 }
131                 if( req->complete )
132                         return NULL;
133
134                 if(req->reset_timeout) {
135                         remaining = (time_t) timeout;
136                         req->reset_timeout = 0;
137                         debug_handler("Recevied a timeout reset");
138                 } else {
139                         remaining -= (int) (time(NULL) - start);
140                 }
141         }
142
143         debug_handler("Returning NULL from app_request_recv after timeout");
144         return NULL;
145 }
146
147 /** Resend this requests original request message */
148 int _osrf_app_request_resend( osrf_app_request* req ) {
149         if(req == NULL) return 0;
150         if(!req->complete) {
151                 debug_handler( "Resending request [%d]", req->request_id );
152                 return _osrf_app_session_send( req->session, req->payload );
153         }
154         return 1;
155 }
156
157
158
159 // --------------------------------------------------------------------------
160 // --------------------------------------------------------------------------
161 // Session API
162 // --------------------------------------------------------------------------
163
164 /** returns a session from the global session hash */
165 osrf_app_session* osrf_app_session_find_session( char* session_id ) {
166         osrf_app_session* ptr = app_session_cache;
167         while( ptr != NULL ) {
168                 if( !strcmp(ptr->session_id,session_id) )
169                         return ptr;
170                 ptr = ptr->next;
171         }
172         return NULL;
173 }
174
175
176 /** adds a session to the global session cache */
177 void _osrf_app_session_push_session( osrf_app_session* session ) {
178
179         if( app_session_cache == NULL ) {
180                 app_session_cache = session;
181                 return;
182         }
183
184         osrf_app_session* ptr = app_session_cache;
185         while( ptr != NULL ) {
186                 if( !strcmp(ptr->session_id, session->session_id) )
187                         return;
188                 if( ptr->next == NULL ) {
189                         ptr->next = session;
190                         return;
191                 }
192                 ptr = ptr->next;
193         }
194 }
195
196
197 /** unlinks from global session cache */
198 void _osrf_app_session_remove_session( char* session_id ) {
199
200         if( app_session_cache == NULL )
201                 return;
202
203         debug_handler( "App Session removing session [%s] from global cache", session_id );
204         if( !strcmp(app_session_cache->session_id, session_id) ) {
205                 if( app_session_cache->next != NULL ) {
206                         osrf_app_session* next = app_session_cache->next;
207                         app_session_cache = next;
208                         return;
209                 } else {
210                         app_session_cache = NULL;
211                         return;
212                 }
213         }
214
215         if( app_session_cache->next == NULL )
216                 return;
217
218         osrf_app_session* prev = app_session_cache;
219         osrf_app_session* ptr = prev->next;
220         while( ptr != NULL ) {
221                 if( ptr->session_id == session_id ) {
222                         osrf_app_session* tmp = ptr->next;
223                         prev->next = tmp;
224                         return;
225                 }
226                 ptr = ptr->next;
227         }
228 }
229
230 /** Allocates a initializes a new app_session */
231
232 osrf_app_session* osrfAppSessionClientInit( char* remote_service ) {
233         return osrf_app_client_session_init( remote_service );
234 }
235
236 osrf_app_session* osrf_app_client_session_init( char* remote_service ) {
237
238         osrf_app_session* session = safe_malloc(sizeof(osrf_app_session));      
239
240         session->transport_handle = osrf_system_get_transport_client();
241         if( session->transport_handle == NULL ) {
242                 warning_handler("No transport client for service 'client'");
243                 return NULL;
244         }
245
246         char target_buf[512];
247         memset(target_buf,0,512);
248         //char* domain  = config_value( "opensrf.bootstrap", "//%s/domains/domain1", osrf_get_config_context() ); /* just the first for now */
249         //char* router_name = config_value( "opensrf.bootstrap", "//%s/router_name", osrf_get_config_context() );
250
251         osrfStringArray* arr = osrfNewStringArray(8);
252         osrfConfigGetValueList(NULL, arr, "/domains/domain");
253         char* domain = osrfStringArrayGetString(arr, 0);
254         char* router_name = osrfConfigGetValue(NULL, "/router_name");
255         osrfStringArrayFree(arr);
256         
257         sprintf( target_buf, "%s@%s/%s",  router_name, domain, remote_service );
258         //free(domain);
259         free(router_name);
260
261         session->request_queue = NULL;
262         session->remote_id = strdup(target_buf);
263         session->orig_remote_id = strdup(session->remote_id);
264         session->remote_service = strdup(remote_service);
265
266         #ifdef ASSUME_STATELESS
267         session->stateless = 1;
268         debug_handler("%s session is stateless", remote_service );
269         #else
270         session->stateless = 0;
271         debug_handler("%s session is NOT stateless", remote_service );
272         #endif
273
274         /* build a chunky, random session id */
275         char id[256];
276         memset(id,0,256);
277
278         sprintf(id, "%lf.%d%d", get_timestamp_millis(), (int)time(NULL), getpid());
279         session->session_id = strdup(id);
280         debug_handler( "Building a new client session with id [%s] [%s]", 
281                         session->remote_service, session->session_id );
282
283         session->thread_trace = 0;
284         session->state = OSRF_SESSION_DISCONNECTED;
285         session->type = OSRF_SESSION_CLIENT;
286         session->next = NULL;
287         _osrf_app_session_push_session( session );
288         return session;
289 }
290
291 osrf_app_session* osrf_app_server_session_init( 
292                 char* session_id, char* our_app, char* remote_id ) {
293
294         info_handler("Initing server session with session id %s, service %s,"
295                         " and remote_id %s", session_id, our_app, remote_id );
296
297         osrf_app_session* session = osrf_app_session_find_session( session_id );
298         if(session) return session;
299
300         session = safe_malloc(sizeof(osrf_app_session));        
301
302         session->transport_handle = osrf_system_get_transport_client();
303         if( session->transport_handle == NULL ) {
304                 warning_handler("No transport client for service '%s'", our_app );
305                 return NULL;
306         }
307
308         int stateless = 0;
309         char* statel = osrf_settings_host_value("/apps/%s/stateless", our_app );
310         if(statel) stateless = atoi(statel);
311         free(statel);
312
313
314         session->request_queue = NULL;
315         session->remote_id = strdup(remote_id);
316         session->orig_remote_id = strdup(remote_id);
317         session->session_id = strdup(session_id);
318         session->remote_service = strdup(our_app);
319         session->stateless = stateless;
320
321         #ifdef ASSUME_STATELESS
322         session->stateless = 1;
323         #endif
324
325         session->thread_trace = 0;
326         session->state = OSRF_SESSION_DISCONNECTED;
327         session->type = OSRF_SESSION_SERVER;
328         session->next = NULL;
329
330         _osrf_app_session_push_session( session );
331         return session;
332
333 }
334
335
336
337 /** frees memory held by a session */
338 void _osrf_app_session_free( osrf_app_session* session ){
339         if(session==NULL)
340                 return;
341         
342         free(session->remote_id);
343         free(session->orig_remote_id);
344         free(session->session_id);
345         free(session->remote_service);
346         free(session);
347 }
348
349 int osrfAppSessionMakeRequest(
350                 osrf_app_session* session, jsonObject* params, 
351                 char* method_name, int protocol, string_array* param_strings ) {
352
353         return osrf_app_session_make_req( session, params, 
354                         method_name, protocol, param_strings );
355 }
356
357 int osrf_app_session_make_req( 
358                 osrf_app_session* session, jsonObject* params, 
359                 char* method_name, int protocol, string_array* param_strings ) {
360         if(session == NULL) return -1;
361
362         osrf_message* req_msg = osrf_message_init( REQUEST, ++(session->thread_trace), protocol );
363         osrf_message_set_method(req_msg, method_name);
364         if(params) {
365                 osrf_message_set_params(req_msg, params);
366
367         } else {
368
369                 if(param_strings) {
370                         int i;
371                         for(i = 0; i!= param_strings->size ; i++ ) {
372                                 osrf_message_add_param(req_msg,
373                                         string_array_get_string(param_strings,i));
374                         }
375                 }
376         }
377
378         osrf_app_request* req = _osrf_app_request_init( session, req_msg );
379         if(!_osrf_app_session_send( session, req_msg ) ) {
380                 warning_handler( "Error sending request message [%d]", session->thread_trace );
381                 return -1;
382         }
383
384         _osrf_app_session_push_request( session, req );
385         return req->request_id;
386 }
387
388
389
390 /** Adds an app_request to the request set */
391 void _osrf_app_session_push_request( osrf_app_session* session, osrf_app_request* req ){
392         if(session == NULL || req == NULL)
393                 return;
394
395         debug_handler( "Pushing [%d] onto requeust queue for session [%s] [%s]",
396                         req->request_id, session->remote_service, session->session_id );
397
398         if(session->request_queue == NULL) 
399                 session->request_queue = req;
400         else {
401                 osrf_app_request* req2 = session->request_queue->next;
402                 session->request_queue = req;
403                 req->next = req2;
404         }
405 }
406
407
408
409 /** Removes an app_request from this session request set */
410 void _osrf_app_session_remove_request( osrf_app_session* session, osrf_app_request* req ){
411         if(session == NULL || req == NULL)
412                 return;
413
414         if(session->request_queue == NULL)
415                 return;
416
417         debug_handler("Removing request [%d] from session [%s] [%s]",
418                         req->request_id, session->remote_service, session->session_id );
419
420         osrf_app_request* first = session->request_queue;
421         if(first->request_id == req->request_id) {
422                 session->request_queue = first->next;
423                 return;
424                 /*
425                 if(first->next == NULL) { 
426                         session->request_queue = NULL;
427                 } else {
428                         osrf_app_request* tmp = first->next;
429                         session->request_queue = tmp;
430                 }
431                 */
432         }
433
434         osrf_app_request* lead = first->next;
435
436         while( lead != NULL ) {
437                 if(lead->request_id == req->request_id) {
438                         first->next = lead->next;
439                         return;
440                 }
441                 first = lead;
442                 lead = lead->next;
443         }
444 }
445
446
447 void osrf_app_session_set_complete( osrf_app_session* session, int request_id ) {
448         if(session == NULL)
449                 return;
450
451         osrf_app_request* req = _osrf_app_session_get_request( session, request_id );
452         if(req) req->complete = 1;
453 }
454
455 int osrf_app_session_request_complete( osrf_app_session* session, int request_id ) {
456         if(session == NULL)
457                 return 0;
458         osrf_app_request* req = _osrf_app_session_get_request( session, request_id );
459         if(req)
460                 return req->complete;
461         return 0;
462 }
463
464 /** Returns the app_request with the given request_id (request_id) */
465 osrf_app_request* _osrf_app_session_get_request( 
466                 osrf_app_session* session, int request_id ){
467         if(session == NULL)
468                 return NULL;
469
470         osrf_app_request* req = session->request_queue;
471         while( req != NULL ) {
472                 if(req->request_id == request_id)
473                         return req;
474                 req = req->next;
475         }
476         return NULL;
477 }
478
479
480 /** Resets the remote connection id to that of the original*/
481 void osrf_app_session_reset_remote( osrf_app_session* session ){
482         if( session==NULL )
483                 return;
484
485         free(session->remote_id);
486         debug_handler( "App Session [%s] [%s] resetting remote id to %s",
487                         session->remote_service, session->session_id, session->orig_remote_id );
488
489         session->remote_id = strdup(session->orig_remote_id);
490 }
491
492 void osrf_app_session_set_remote( osrf_app_session* session, char* remote_id ) {
493         if(session == NULL)
494                 return;
495         if( session->remote_id )
496                 free(session->remote_id );
497         session->remote_id = strdup( remote_id );
498 }
499
500 /** pushes the given message into the result list of the app_request
501   with the given request_id */
502 int osrf_app_session_push_queue( 
503                 osrf_app_session* session, osrf_message* msg ){
504
505         if(session == NULL || msg == NULL)
506                 return 0;
507
508         osrf_app_request* req = session->request_queue;
509
510         if(req == NULL) return 0;
511
512         while( req != NULL ) {
513                 if(req->request_id == msg->thread_trace) {
514                         _osrf_app_request_push_queue( req, msg );
515                         return 1;
516                 }
517                 req = req->next;
518         } 
519
520         return 0;
521         
522 }
523
524 /** Attempts to connect to the remote service */
525 int osrf_app_session_connect(osrf_app_session* session){
526         
527         if(session == NULL)
528                 return 0;
529
530         if(session->state == OSRF_SESSION_CONNECTED) {
531                 return 1;
532         }
533
534         int timeout = 5; /* XXX CONFIG VALUE */
535
536         debug_handler( "AppSession connecting to %s", session->remote_id );
537
538         /* defaulting to protocol 1 for now */
539         osrf_message* con_msg = osrf_message_init( CONNECT, session->thread_trace, 1 );
540         osrf_app_session_reset_remote( session );
541         session->state = OSRF_SESSION_CONNECTING;
542         int ret = _osrf_app_session_send( session, con_msg );
543         osrf_message_free(con_msg);
544         if(!ret)        return 0;
545
546         time_t start = time(NULL);      
547         time_t remaining = (time_t) timeout;
548
549         while( session->state != OSRF_SESSION_CONNECTED && remaining >= 0 ) {
550                 osrf_app_session_queue_wait( session, remaining );
551                 remaining -= (int) (time(NULL) - start);
552         }
553
554         if(session->state == OSRF_SESSION_CONNECTED)
555                 debug_handler(" * Connected Successfully to %s", session->remote_service );
556
557         if(session->state != OSRF_SESSION_CONNECTED)
558                 return 0;
559
560         return 1;
561 }
562
563
564
565 /** Disconnects from the remote service */
566 int osrf_app_session_disconnect( osrf_app_session* session){
567         if(session == NULL)
568                 return 1;
569
570         if(session->state == OSRF_SESSION_DISCONNECTED)
571                 return 1;
572
573         if(session->stateless && session->state != OSRF_SESSION_CONNECTED) {
574                 debug_handler(
575                                 "Exiting disconnect on stateless session %s", 
576                                 session->session_id);
577                 return 1;
578         }
579
580         debug_handler( "AppSession disconnecting from %s", session->remote_id );
581
582         osrf_message* dis_msg = osrf_message_init( DISCONNECT, session->thread_trace, 1 );
583         session->state = OSRF_SESSION_DISCONNECTED;
584         _osrf_app_session_send( session, dis_msg );
585
586         osrf_message_free( dis_msg );
587         osrf_app_session_reset_remote( session );
588         return 1;
589 }
590
591 int osrf_app_session_request_resend( osrf_app_session* session, int req_id ) {
592         osrf_app_request* req = _osrf_app_session_get_request( session, req_id );
593         return _osrf_app_request_resend( req );
594 }
595
596
597 int osrfAppSessionSendBatch( osrfAppSession* session, osrf_message* msgs[], int size ) {
598
599         if( !(session && msgs && size > 0) ) return 0;
600         int retval = 0;
601
602
603         osrfMessage* msg = msgs[0];
604
605         if(msg) {
606
607                 osrf_app_session_queue_wait( session, 0 );
608
609                 /* if we're not stateless and the first message is not a connect
610                         message, then we do the connect first */
611                 if(session->stateless) {
612                                 osrf_app_session_reset_remote(session);
613
614                 } else {
615
616                         if( (msg->m_type != CONNECT) && (msg->m_type != DISCONNECT) &&
617                                 (session->state != OSRF_SESSION_CONNECTED) ) {
618                                 if(!osrf_app_session_connect( session )) 
619                                         return 0;
620                         }
621                 }
622         }
623
624         char* string = osrfMessageSerializeBatch(msgs, size);
625
626         if( string ) {
627
628                 transport_message* t_msg = message_init( 
629                                 string, "", session->session_id, session->remote_id, NULL );
630         
631                 debug_handler("Session [%s] [%s]  sending to %s \nData: %s", 
632                                 session->remote_service, session->session_id, t_msg->recipient, string );
633
634                 retval = client_send_message( session->transport_handle, t_msg );
635         
636                 free(string);
637                 message_free( t_msg );
638         }
639
640         return retval; 
641
642
643 }
644
645
646
647 int _osrf_app_session_send( osrf_app_session* session, osrf_message* msg ){
648         if( !(session && msg) ) return 0;
649         osrfMessage* a[1];
650         a[0] = msg;
651         return osrfAppSessionSendBatch( session, a, 1 );
652 }
653
654
655
656
657 /**  Waits up to 'timeout' seconds for some data to arrive.
658   * Any data that arrives will be processed according to its
659   * payload and message type.  This method will return after
660   * any data has arrived.
661   */
662 int osrf_app_session_queue_wait( osrf_app_session* session, int timeout ){
663         if(session == NULL) return 0;
664         int ret_val = 0;
665         debug_handler( "AppSession in queue_wait with timeout %d", timeout );
666         ret_val = osrf_stack_entry_point(session->transport_handle, timeout);
667         return ret_val;
668 }
669
670 /** Disconnects (if client) and removes the given session from the global session cache 
671   * ! This free's all attached app_requests ! 
672   */
673 void osrfAppSessionFree( osrfAppSession* ses ) {
674         osrf_app_session_destroy( ses );
675 }
676
677
678 void osrf_app_session_destroy( osrf_app_session* session ){
679         if(session == NULL) return;
680
681         debug_handler( "AppSession [%s] [%s] destroying self and deleting requests", 
682                         session->remote_service, session->session_id );
683         if(session->type == OSRF_SESSION_CLIENT 
684                         && session->state != OSRF_SESSION_DISCONNECTED ) { /* disconnect if we're a client */
685                 osrf_message* dis_msg = osrf_message_init( DISCONNECT, session->thread_trace, 1 );
686                 _osrf_app_session_send( session, dis_msg ); 
687                 osrf_message_free(dis_msg);
688         }
689         //session->state = OSRF_SESSION_DISCONNECTED;
690         _osrf_app_session_remove_session(session->session_id);
691
692         osrf_app_request* req;
693         while( session->request_queue != NULL ) {
694                 req = session->request_queue->next;
695                 _osrf_app_request_free( session->request_queue );
696                 session->request_queue = req;
697         }
698
699         _osrf_app_session_free( session );
700 }
701
702 osrf_message* osrfAppSessionRequestRecv(
703                 osrf_app_session* session, int req_id, int timeout ) {
704         return osrf_app_session_request_recv( session, req_id, timeout );
705 }
706 osrf_message* osrf_app_session_request_recv( 
707                 osrf_app_session* session, int req_id, int timeout ) {
708         if(req_id < 0 || session == NULL)
709                 return NULL;
710         osrf_app_request* req = _osrf_app_session_get_request( session, req_id );
711         return _osrf_app_request_recv( req, timeout );
712 }
713
714
715
716 int osrfAppRequestRespond( osrfAppSession* ses, int requestId, jsonObject* data ) {
717         if(!ses || ! data ) return -1;
718
719         osrf_message* msg = osrf_message_init( RESULT, requestId, 1 );
720         char* json = jsonObjectToJSON( data );
721         osrf_message_set_result_content( msg, json );
722         _osrf_app_session_send( ses, msg ); 
723
724         free(json);
725         osrf_message_free( msg );
726
727         return 0;
728 }
729
730
731 int osrfAppRequestRespondComplete( 
732                 osrfAppSession* ses, int requestId, jsonObject* data ) {
733
734         osrf_message* payload = osrf_message_init( RESULT, requestId, 1 );
735         osrf_message_set_status_info( payload, NULL, "OK", OSRF_STATUS_OK );
736
737         char* json = jsonObjectToJSON( data );
738         osrf_message_set_result_content( payload, json );
739         free(json);
740
741         osrf_message* status = osrf_message_init( STATUS, requestId, 1);
742         osrf_message_set_status_info( status, "osrfConnectStatus", "Request Complete", OSRF_STATUS_COMPLETE );
743
744         osrfMessage* ms[2];
745         ms[0] = payload;
746         ms[1] = status;
747
748         osrfAppSessionSendBatch( ses, ms, 2 );
749
750         osrf_message_free( payload );
751         osrf_message_free( status );
752
753         /* join and free */
754
755         return 0;
756 }
757
758
759
760 int osrfAppSessionStatus( osrfAppSession* ses, int type, int reqId, char* message ) {
761
762         if(ses) {
763                 osrf_message* msg = osrf_message_init( STATUS, reqId, 1);
764                 osrf_message_set_status_info( msg, "Server Error", message, type );
765                 _osrf_app_session_send( ses, msg ); 
766                 osrf_message_free( msg );
767                 return 0;
768         }
769         return -1;
770 }
771
772
773
774
775
776